// Vector algebra utility routine
#ifndef VUTILITY_H
#define VUTILITY_H

template<typename T> T vround(double dv) {}
template<typename T> T vroundp(double dv) {}

template<> inline int vround<int>(double dv)
{ 
  return (dv>0)?static_cast<int>(dv+0.5):static_cast<int>(dv-0.5);
}

template<> inline long vround<long>(double dv)
{ 
  return (dv>0)?static_cast<long>(dv+0.5):static_cast<long>(dv-0.5);
}

template<> inline int vroundp<int>(double dv)
{
  return static_cast<int>(dv+0.5);
}

template<> inline long vroundp<long>(double dv)
{ 
  return static_cast<long>(dv+0.5);
}

#endif // VUTILITY_H